package com.hao1st.service2.biz.rpcdemo.controller;

import com.hao1st.service2.rpc.Service1Rpc;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/rpc")
public class RpcController {

    @Resource
    private Service1Rpc service1Rpc;

    @GetMapping("/invoke")
    public String rpcService1() {
        // 调用接口访问service2
        return service1Rpc.rpcService1();
    }
}
